import React, { useRef } from "react";
import { Button, Watermark } from "antd";
import {
  CaretRightOutlined,
  VerticalAlignBottomOutlined,
} from "@ant-design/icons";
import Dialog from "../../components/Dialog/index";

export default function shopping() {
  const childRef = useRef(null);

  const goLogin = () => {
    if (childRef.current) {
      childRef.current.childMethod();
    }
  };

  //关闭
  const close = () => {
    childRef.current.childMethod();
  };

  return (
    <>
      <Watermark content="全栈2201A">
        <div>购物车页面</div>
        <Dialog
          ref={childRef}
          logoName={<div>支付</div>}
          logoImg={
            <img
              src="https://www.baidu.com/img/flexible/logo/pc/result@2.png"
              alt=""
            />
          }
        >
          <div onClick={close}>X</div>
        </Dialog>
        {/* <button onClick={goLogin}>登录</button> */}
        <Button style={{ marginLeft: 30 }} type="primary">
          <VerticalAlignBottomOutlined /> Button
        </Button>
      </Watermark>
    </>
  );
}
